<meta charset="utf-8" />
<script src="./utils.js"></script>

<h1>1、日期格式化</h1>
<div id="demo1"></div>
<div id="demo11"></div>
<script>
    var result1 = ''
    var result2 = ''
    // result += "dateFormat('2022-4-11 19.00.00') //" + dateFormat('2022-4-11 19.00.00') + "<br />"  
    // result += "dateFormat('2022-4-11 18.00.00') //" + dateFormat('2022-4-11 18.00.00') + "<br />" 
    // document.querySelector('#demo1').innerHTML = result
    // result="dateFormat('2022-4-14 19.00.00') //" + dateFormat('2022-4-14 19.00.00')+ "<br />"  
    // result2="dateFormat('2022-4-11 18.00.00') //" + dateFormat('2022-4-11 18.00.00')+ "<br />"  

    // document.querySelector('#demo1').innerHTML= result
    // document.querySelector('#demo1').innerHTML=dateFormat('2022-4-14 22:26:00')
    result1="dateFormat('2022-4-11 22:26:00') //" + dateFormat('2022-4-11 22:26:00')
    document.querySelector('#demo1').innerHTML=result1
    result2="dateFormat('2022-4-14 22:26:00') //" + dateFormat('2022-4-14 22:26:00')
    document.querySelector('#demo11').innerHTML=result2
</script>

<h1>2、快速获取当前时间</h1>
<div id="demo2"></div>
<script>
    var result = ''
    result += "format('YmdHis') //"+format('YmdHis') + "<br />"  
    result += "format('Y/m/d') //"+format('Y/m/d') + "<br />"  
    result += "format('Y-m-d H:i:s') //"+format('Y-m-d H:i:s') + "<br />" 
    document.querySelector('#demo2').innerHTML = result
</script>

<h1>3、获取随机16进制颜色</h1>
<div id="demo3"></div>
<script>
    var result = ''
    result += "randomColor() //"+randomColor() + "<br />"  
    document.querySelector('#demo3').innerHTML = result
</script>

<h1>4、判断用户浏览器</h1>
<div id="demo4"></div>
<script>
    var result = ''
    result += "getBrowser() //"+getBrowser() + "<br />"  
    document.querySelector('#demo4').innerHTML = result
</script>

<h1>5、判断网站在PC还是移动端打开</h1>
<div id="demo5"></div>
<script>
    var result = ''
    result += "getOS() //"+getOS() + "<br />"  
    document.querySelector('#demo5').innerHTML = result
</script>

<h1>6、判断是否是微信浏览器</h1>
<div id="demo6"></div>
<script>
    var result = ''
    result += "isWx() //"+isWx() + "<br />"  
    document.querySelector('#demo6').innerHTML = result
</script>

<h1>7、字符串补0</h1>
<div id="demo7"></div>
<script>
    var result = ''
    result += "zeroize(1) //"+zeroize(1) + "<br />"  
    result += "zeroize(11) //"+zeroize(11) + "<br />"  
    document.querySelector('#demo7').innerHTML = result
</script>

<h1>8、获取标签样式</h1>
<style>
    #demo8{
        background: pink;
        color: yellow;
        width: 88px;
        height: 20px;
        margin: 0;
        display: block;
    }
</style>
<div id="demo8">酱酱小公主</div>
<div id="demo9"></div>
<script>
    var result = ''
    result += "getStyle(document.querySelector('#demo8'),background) //"+getStyle(document.querySelector('#demo8'),'background') + "<br />"  
    result += "getStyle(document.querySelector('#demo8'),color) //"+getStyle(document.querySelector('#demo8 '),'color') + "<br />"  
    document.querySelector('#demo9').innerHTML = result
</script>


<h1>9、JSON内置API的parse方法</h1>
<div id="demo9"></div>
<script>
    let javaData = '{"a":111,"b":"abcde","c":true,"d":"哈哈哈","e":"略略略"}'
    console.log(parse(javaData));
</script>

<h1>10、JSON内置API的stringify方法</h1>
<div id="demo10"></div>
<script>
    
    console.log(stringify({a:123,b:234,c:"嘿嘿嘿",d:"哈哈哈"}));
</script>